home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / prog_disc / volume_7 / issue_08 / basicforum / TS_Kate (.txt) < prev    next >
Encoding:
RISC OS BBC BASIC V Source  |  1994-03-07  |  2.2 KB  |  91 lines

  1.  >TemplateSz get template sizes
  2. " at line ";
  3. getfile
  4. print
  5. getfile
  6. '"Enter file name or * command:"'file$
  7. file$,1)="*" 
  8. file$
  9.      F%=0
  10. file$
  11. F%=0 
  12. "File "file$" not found"
  13. F%<>0
  14. #F%:a%+=(
  15. #F%)<<8:a%+=(
  16. #F%)<<16:a%+=(
  17. #F%)<<24
  18. print
  19. "Print (Y/N)? ";
  20. "YyNn",a$)
  21. a%<3:
  22.      U%=-1
  23. !,largest_def% = 0 : total_indirected% = 0
  24. 0,1)" File: ";file$" with ";M%+1" windows"'
  25. "   name     #ic #iic  i-space b-space iic offst iic offst iic offst iic offst"
  26.  I%=0
  27. %) L%=12-
  28. name$(I%):name$(I%)+=
  29. L%," ")
  30. &* @%=3:
  31. name$(I%),nicon%(I%),nind%(I%);
  32.  @%=7:
  33. indi%(I%),size%(I%);
  34. (# total_indirected% += indi%(I%)
  35.  size%(I%) > largest_def% 
  36.  largest_def% = size%(I%)
  37. nind%(I%)>0 
  38.   @%=5
  39.  J%=1
  40. nind%(I%)
  41. -'   U%+=1:
  42. indn%(U%),inds%(U%)-ind%;
  43. .)   
  44.  J%<nind%(I%) 
  45. 35," ");
  46.  '"Largest template definition       = "+
  47. largest_def%+" (&"+
  48. ~(largest_def%)+")"
  49.  "Total indirected buffer space     = "+
  50. total_indirected%+" (&"+
  51. ~(total_indirected%)+")"
  52.  "Buffer size for Wimp_LoadTemplate = "+
  53. (largest_def% + total_indirected%)+" (&"+
  54. ~(largest_def% + total_indirected%)+")"
  55.  name$(100),nicon%(100),indi%(100),size%(100),nind%(100)
  56.  inds%(500),indn%(500)
  57.  name% 12,blk% &5000,ind% &2000
  58. #F%=16
  59. M%=-1:O%=
  60.  M%+=1:size%(M%)=
  61. #F%+16
  62. #F%:F%=0
  63.  "Wimp_OpenTemplate",,file$
  64. N%=0:M%=-1:U%=-1
  65.  $name%="*"
  66.  "Wimp_LoadTemplate",,blk%,ind%,ind%+&2000,-1,name%,N% 
  67.  ,,R%,,,,N%
  68. N%>0 
  69.   M%+=1
  70.   name$(M%)=$name%
  71.   indi%(M%)=R%-ind%
  72.   nicon%(M%)=blk%!84
  73.   V%=0
  74. indi%(M%)>0 
  75. PE   
  76. (&100 
  77.  blk%!56)>0 V%+=1:U%+=1:inds%(U%)=blk%!72:indn%(U%)=-1
  78.  blk%!84>0 
  79.     I%=blk%+88
  80.  (blk%!84)-1
  81. TC     
  82. (&100 
  83.  I%!16)>0 V%+=1:U%+=1:inds%(U%)=I%!20:indn%(U%)=J%
  84.      I%+=32
  85. V        
  86.   nind%(M%)=V%
  87.  N%=0
  88.  "Wimp_CloseTemplate"
  89. F%<>0 
  90. #F%:F%=0
  91.